// Aufgabe_11_4_Knuffi_Teppich

var bild;

function preload(){
  bild = loadImage("Knuffi.jpg");
}

function setup() {
  createCanvas(600, 600, WEBGL);
}

function draw(){
  background(100, 200, 100);
  kreis(0, 0, 200, 200);
}

function kreis(x, y, b, h){
  texture(bild);
  ellipse(x, y, b, h);

 if(b > 5){
  // waagerecht und senkrecht
  kreis(x+b, y, b/3, h/3);
  kreis(x-b, y, b/3, h/3);
  kreis(x, y+b, b/3, h/3);
  kreis(x, y-b, b/3, h/3);
 // diagonal
  kreis(x+b, y+b, b/3, h/3);
  kreis(x-b, y-b, b/3, h/3);
  kreis(x+b, y-b, b/3, h/3);
  kreis(x-b, y+b, b/3, h/3);
 }
}
